#!/usr/bin/env bash

SRC_FILE=$1

if [[ "$1x" == "x"  ]];then
    echo "input empty"
    exit -1
fi

echo "[1/2] will compile [${SRC_FILE}]!"

gcc main.c      \
    ${SRC_FILE} \
    -g          \
    -o main

## uthash headers
# gcc main.c      \
#     ${SRC_FILE} \
#     -g          \
#     -I uthdrs   \
#     -o main

if [ $? != 0   ]; then
    echo "compile fail!"
    exit 0
fi

echo "[2/2] begin run main!"
./main

